using UnityEngine;

public class BugReportButton : MonoBehaviour
{
	private ButtonViewUpdate _buttonUpdater;

	private ButtonViewUpdate buttonUpdater
	{
		get
		{
			if (_buttonUpdater == null)
			{
				_buttonUpdater = GetComponent<ButtonViewUpdate>();
			}
			return _buttonUpdater;
		}
	}

	private void OnEnable()
	{
		UpdateButton();
	}

	private void UpdateButton()
	{
		bool isOn = GGSupportMenu.instance.isNetworkConnected();
		buttonUpdater.UpdateButtonView(isOn);
		GetComponent<UIButton>().enabled = isOn;
	}

	public void OnSubmitBugReport()
	{
		GGSupportMenu.instance.SubmitBugReport(GGPlayerSettings.instance.Model.name, GGServerConstants.instance.appName, BehaviourSingletonInit<GGServerRequestsBackend>.instance.cachedPlayerId);
	}
}
